home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Diva X: Rebecca
/
Diva X - Rebecca.iso
/
install.rul
< prev
next >
Wrap
Text File
|
1993-11-29
|
10KB
|
320 lines
//
// DIVA X CD-ROM 1995 Installation Script
// (c) 1995, PIXIS Interactive. All rights reserved.
//
// Installs Video for Windows 1.1E and DIVA X.
//
// creates "PIXIS" program group, installs icons.
// Define some predefined constants. Can be used for number only
//
#define MAX_SIZE 145
#define BASE_FILE_SIZE 1000000
#define ALT_FILE_SIZE 1000000
declare // Must use declare keyword to start variable declaration
string szText[ MAX_SIZE ];
string szTmpTAR[ MAX_SIZE ], szTmpSRC[ MAX_SIZE ]; // temp path vars
string szDestPath[ MAX_SIZE ], szResultPath[ MAX_SIZE ];
string szDisk[50];
string szErrMsg [ 255 ], szErrFile [ 100 ], szMsg [ 100 ];
string szREADME [ 100 ], szPath[ 200 ];
string szCommand[ 200 ], szBIN[ MAX_SIZE ];
string szHELPPath[ MAX_SIZE ], szBINPath[ 50 ];
string szPgrp[ 40 ];
string szIcon[ 40 ];
string SourcePath[40];
string szCurrent[40];
string szPrevious[40];
string szCopyFile[50];
string szTempTARGET[145], szErrorTempTARGET[145];
string szTempSRC[145], szErrorTempSRC[145];
string szMessageBox[145];
string szFindFile[50];
string szMessage[50];
string szFullPathError[150];
string szSetFileInfoPath[150];
number nUninstall, nInstall;
number nSpace, nCount;
number nFile, nQTdel;
number copyflag, LoopFlag;
program /* Must use program keyword to start the statements */
Start:
Disable( BACKGROUND );
// Set the color of the background to be Gradiant
SetColor( BACKGROUND, QUAD( BK_RESET, 0, 0, 0 ));
SetColor( BACKGROUND, QUAD( BK_VERT_TOP, 0, 0, 0 ));
SetColor( BACKGROUND, QUAD( BK_VERT_BOTTOM, 255, 255, 255 ));
SetColor( BACKGROUND, QUAD( BK_COMPLETE, 255, 255, 255 ));
SetColor( STATUSBAR, RED );
SetFont( FONT_TITLE, STYLE_ITALIC, "Arial" );
SetTitle( "DIVA X", 35, RGB(255,255,255) );
// Enable various objects.
Enable( INDVFILESTATUS ); // Shows all filenames when copied.
Disable( HELP ); //
Enable( EXIT ); // Exit Button
Enable( PAUSE ); // Pause Button
Enable( STATUS ); // Status , % Complete Bar Window
// Enable( TEXT ); // Info Windows
Enable( FEEDBACK_FULL); // Feedback window enabled
Enable( BACKGROUND );
// Determine target location for files
GetDisk( TARGETDIR, szDisk );
StrCopy( szDestPath, szDisk );
StrConcat( szDestPath, "\\DIVAX" ); // Note: the double slashes
DrawBitmap:
// Determine the source path of the bitmap file
StrCopy( szResultPath, SRCDIR );
AppendToPath( szResultPath, "PIXIS.BMP" );
// Place our product logo in the top right corner
PlaceBitmap( szResultPath, 101, 20, 20, LOWER_LEFT);
TargetLoc:
// Increment % Complete Bar to 4 %, & display message
SetStatusWindow( 1, "Installing DIVA X" );
// Want to ask user for a path to install VCR
StrCopy( szText, "Enter the desired path for Diva Program Files(example: C:\\DIVAX)" );
AskPath( szText, szDestPath, szResultPath );
if LAST_RESULT = FALSE then call ConfirmCancel; endif;
StrCompare( szResultPath, SRCDIR );
if LAST_RESULT = 0 then
MessageBox( "The target location must be different than the source.\nPlease specify a different location.",WARNING );
goto TargetLoc;
endif;
StrCopy( szBINPath, szResultPath );
GetDisk( szResultPath, szDisk );
// If correct disk entered, then BeginInstall;
ExistsDisk( szDisk );
if LAST_RESULT != 0 then
// Invalid disk entered, reprompt
StrCopy( szText, szResultPath );
StrConcat( szText, "- is an invalid disk, press Ok to return to the path selection");
MessageBox( szText, WARNING );
goto TargetLoc;
endif;
BeginInstall:
SetStatusWindow( 10, "Check available disk space." ); // 10%
GetDisk( szResultPath, szDisk );
// Check to see if enough space is free on the destination.
// GetDiskSpace returns free space in LAST_RESULT.
GetDiskSpace( szDisk );
if LAST_RESULT < nSpace then
StrCopy( szText, "Not enough space on ");
StrConcat( szText, szDisk );
StrConcat( szText, "-Please press OK to try another target disk");
MessageBox( szText, WARNING );
goto TargetLoc;
endif;
EnoughSpace:
SetStatusWindow( 15, "Check existing installation" ); // 15%
// Check to see if Directory Exists
// ExistsDir returns value in LAST_RESULT
ExistsDir( szResultPath );
if LAST_RESULT = 0 goto DirExists;
CreateDir( szResultPath );
if LAST_RESULT = 0 goto DirExists;
StrCopy( szText, "Unable to create specified path -");
StrConcat( szText, szResultPath );
StrConcat( szText, "Please enter a correct path like C:\\DIRECTRY");
MessageBox( szText, WARNING );
goto TargetLoc;
DirExists:
//*************************************************************
// Copy Files to HD:
//
// Description:
// Copy README.WRI to directory in szResultPathand
// and Director support files to windows/system directory
//*************************************************************
SetStatusWindow( 18, "Installing DIVA X - Dir Exists" ); //18%
StrCopy(szTmpTAR, TARGETDIR); // SAVE TARGET
StrCopy(szTmpSRC, SRCDIR); // SAVE SOURCE
StrCopy(TARGETDIR, szResultPath);
StrCopy(szCopyFile, "README.WRI");
call Copy_This;
StrConcat(SRCDIR, "BIN"); // SET SOURCE DIR TO ROOT DIRECTORY ON CD
//StrCopy(TARGETDIR, WINSYSDIR); // SET TARTGET TO WINDOWS SYSTEM DIR
SetStatusWindow(30, "Installing DIVA X main files" );
StrCopy(szCopyFile, "Diva1.EXE");
call Copy_This;
SetStatusWindow(35, "Installing DIVA X main files" );
StrCopy(szCopyFile, "Diva.ICO");
call Copy_This;
SetStatusWindow( 39, "Installing DIVA X support files" );
StrCopy(szCopyFile, "DIALOGS.DLL");
call Copy_This;
SetStatusWindow( 45, "Installing DIVA X support files" );
StrCopy(szCopyFile, "MESSAGE.DLL");
call Copy_This;
SetStatusWindow( 85, "Installing DIVA X support files" );
StrCopy(szCopyFile, "FILEIO.DLL");
call Copy_This;
SetStatusWindow( 93, "Installing DIVA X support files" );
StrCopy(szCopyFile, "LINGO.INI");
call Copy_This;
StrCopy(TARGETDIR, szTmpTAR); // RESTORE TARTGET DIR
StrCopy(SRCDIR, szTmpSRC); // RESTORE SOURCE DIR
//****************************************************************
// Complete:
//
// Description:
// Create Program Icons and Groups for various .exe files.
// Also launches Video for Windows 1.1E installer.
//**************************************************************
Complete:
// Now create a program group & icons
SetStatusWindow( 95, "Creating Program Group & Icons"); // 95%
Delay( 1 );
AppCommand( PROGMAN, CMD_RESTORE );
StrCopy( szPgrp, "DIVA X" );
DeleteGroup( szPgrp );
// ADD README TO PROGRAM GROUP
StrCopy( szPath, szResultPath);
AppendToPath( szPath, "README.WRI" );
StrCopy( szCommand, "WRITE ");
StrConcat( szCommand, szPath );
AddProgItem( szPgrp, "Read Me!", szCommand, "");
// ADD DIVA X TO PROGRAM GROUP
StrCopy( szPath, szResultPath);
AppendToPath( szPath, "DIVA1.EXE" );
StrCopy( szCommand, szPath );
StrCopy( szIcon, szResultPath);
AppendToPath( szIcon, "DIVA.ICO" );
AddProgItem( szPgrp, "DIVA X", szCommand, szIcon );
AppCommand( PROGMAN, CMD_PUSHDOWN );
// ASK Video for Windows 1.1E INSTALL
AskVFWInstall:
// FIRST WARN USER THAT DIRECTOR 4.0 PROJECTORS WILL GET HARMLESS ERROR MESSAGE
// AS A RESULT OF .DLLS FROM OLDER VERSIONS OF DIRECTOR IN THEIR SYSTEM FOLDER
MessageBox("When launching 'DIVA X' you may get a Script Error Message 'Xlib file not found'. Click 'Continue' to proceed.", INFORMATION);
AskYesNo("DIVA X requires Video for Windows 1.1E or better to run properly. Click 'Yes' to install Video for Windows 1.1E?", TRUE);
if LAST_RESULT = FALSE then
call ConfirmCancel;
goto AskVFWInstall;
endif;
/////////////// Launch Video for Windows 1.1E Installer ////////////////////////////
StrCopy(SourcePath, SRCDIR);
StrConcat(SourcePath, "Vfw11e\\SETUP.exe");
LaunchApp(SourcePath, "");
MessageBox("DIVA X has been installed successfully.", INFORMATION);
exit;
//**************************************************************
// Copy_This
//
// Description:
// called By CopyDirectorFiles. The file to be copied is
// 'passed' in the szCopyFile string variable. If the copy is
// unsuccessfull, a message appears directing the user to make a
// note of the problem file and look for further instructions in
// the README file
//**************************************************************
Copy_This:
CopyFile(szCopyFile, szCopyFile);
if LAST_RESULT < 0 then
StrCopy(szErrMsg, "Cannot copy file ");
StrConcat(szErrMsg, szCopyFile);
StrConcat(szErrMsg, ". Please make a note of this file name and refer to the 'Install Errors' section of the README file");
MessageBox(szErrMsg, WARNING);
endif;
return;
//*****************************************************************
// ConfirmCancel
//
// Description:
// This procedure will confirm with the users if they want
// to terminate the installation of the PIXIS product.
//*******************************************************************
ConfirmCancel:
AskYesNo( "Are you sure you want to CANCEL installation ?", FALSE );
if LAST_RESULT = FALSE then return; endif;
exit;